package com.threadpool.mythread.case01;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.function.Supplier;
import java.util.stream.Collectors;

/**
 * @Author 李李李
 * @2020/4/26 21:23
 *
 * 供给型接口  没有入参  只有返回值
 *
 */
public class Case14 {
    public static void main(String[] args) {

        List<String> list = new ArrayList<>(10);
        for (int i =0;i <10;i++){
            list.add(String.valueOf(i));
        }

        Supplier<Integer> supplier = new Supplier<Integer>() {
            @Override
            public Integer get() {
                return 1024;
            }
        };

        Supplier<Integer> supplier2 = ()->{return 1024;};

        System.out.println(supplier.get());
        System.out.println(supplier2.get());
    }
}
